package br.com.fidalgotecnologia.layar.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

@Entity
@Table(schema="poi", name="hotspot")
@SequenceGenerator(sequenceName="poi.hotspot_id_seq" , name="hotspot_seq")

public class HotSpot implements Serializable {
	private Long id;
	private Anchor anchor;
	private Text text;
	private byte[] imagem;
	private Object object;
	private Transform transform;
	private boolean doNotIndex;
	private boolean inFocus;
	private boolean showSmallBiw;
	private boolean showBiwOnClick;
	//private Animation animation;
	private Icon icon;
	private String biwStyle;
	private Layer layer;
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="hotspot_seq")
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@ManyToOne(cascade={CascadeType.ALL})
    @JoinColumn(name="objeto")
	public Object getObject() {
		return object;
	}
	public void setObject(Object object) {
		this.object = object;
	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="transform")
	public Transform getTransform() {
		return transform;
	}
	public void setTransform(Transform transform) {
		this.transform = transform;
	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="anchor")
	public Anchor getAnchor() {
		return anchor;
	}
	public void setAnchor(Anchor anchor) {
		this.anchor = anchor;
	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="text")
	public Text getText() {
		return text;
	}
	public void setText(Text text) {
		this.text = text;
	}
	@Type(type="org.hibernate.type.BinaryType")
	@Column(name="imagem", columnDefinition = "bytea")
	public byte[] getImagem() {
		return imagem;
	}
	public void setImagem(byte[] imagem) {
		this.imagem = imagem;
	}
	//	@ManyToOne
//	@JoinColumn(name="animation")
//	public Animation getAnimation() {
//		return animation;
//	}
//	public void setAnimation(Animation animation) {
//		this.animation = animation;
//	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="icon")
	public Icon getIcon() {
		return icon;
	}
	public void setIcon(Icon icon) {
		this.icon = icon;
	}
	@Column(name="biwStyle")
	public String getBiwStyle() {
		return biwStyle;
	}
	public void setBiwStyle(String biwStyle) {
		this.biwStyle = biwStyle;
	}
	@Column(name="indexar")
	public boolean isDoNotIndex() {
		return doNotIndex;
	}
	public void setDoNotIndex(boolean doNotIndex) {
		this.doNotIndex = doNotIndex;
	}
	@Column(name="focar")
	public boolean isInFocus() {
		return inFocus;
	}
	public void setInFocus(boolean inFocus) {
		this.inFocus = inFocus;
	}
	@Column(name="show_small_biw")
	public boolean isShowSmallBiw() {
		return showSmallBiw;
	}
	public void setShowSmallBiw(boolean showSmallBiw) {
		this.showSmallBiw = showSmallBiw;
	}
	@Column(name="show_biw_on_click")
	public boolean isShowBiwOnClick() {
		return showBiwOnClick;
	}
	public void setShowBiwOnClick(boolean showBiwOnClick) {
		this.showBiwOnClick = showBiwOnClick;
	}
	@ManyToOne
	@JoinColumn(name="layer_id")
	public Layer getLayer() {
		return layer;
	}
	public void setLayer(Layer layer) {
		this.layer = layer;
	}
	
	
}